package com.chenfan.infra.context;

public class TenantContextHolder {
    private static final InheritableThreadLocal<Long> CONTEXT = new InheritableThreadLocal<>();

    private TenantContextHolder() {
    }

    public static void setTenantId(Long tenantId) {
        CONTEXT.set(tenantId);
    }

    public static Long getTenantId() {
        return CONTEXT.get();
    }

    public static void clear() {
        CONTEXT.remove();
    }
}